<script>

    import {BaiduMapUtil} from "./dev/core/utils/baiduMap.util";

    export default {
        onLaunch: function () {
            console.log('App Launch')
            console.log('获取系统信息----------------', uni.getSystemInfoSync());
        },
        onShow: function () {
            console.log('App Show')
            const _self = this;
            uni.getLocation({
                type: 'wgs84',
                success: function (event) {
                    console.log('获取手机坐标系成功-------------------', event);
                    // latitude: 23.12463 longitude: 113.36199
                    // wgs84转百度坐标系
                    let coord = BaiduMapUtil.wgs84togcj02tobd09(Number(event.longitude.toFixed(5)), Number(event.latitude.toFixed(5)));
                    if (coord.lng && coord.lat) {
                        _self.globalVariable.coordinate = coord.lng + "," + coord.lat;
                    }
                },
                fail: function (event) {
                    console.log('获取手机坐标系失败-------------------', event);
                }
            })
        },
        onHide: function () {
            console.log('App Hide')
        }
    }
</script>

<style lang="scss">
    @import "uview-ui/index.scss";
    /*每个页面公共css */

    page {
        /*min-height: 100%;*/
        height: 100%;
    }

    .bg-content {
        min-height: 100%;
        background: #eeeeee;
    }

    .skin {
        /*background: #d81e06 !important;*/
        background: #fa3534 !important;
        color: white !important;
    }

    .skin-font {
        color: #fa3534 !important;
    }

    .skin-border {
        border: 1px solid #fa3534 !important;
        padding: 4px 8px;
    }

    .hidden {
        display: none;
    }

    .text-center {
        text-align: center;
    }

    .bold {
        font-weight: bold;
    }

    .custom-bottom-bar {
        z-index: 99;
        display: flex;
        width: 100%;
        position: fixed;
        bottom: 0px;
        min-height: 50px;
        background-color: #ffffff;
        border-top: 1px solid #eeeeee;
    }

    .custom-bottom-button {
        z-index: 99;
        display: flex;
        width: 100%;
        position: fixed;
        bottom: 0px;
        height: 50px;
        background-color: #fa3534;
        text-align: center;
        color: #FFFFFF;
        cursor: pointer;

        label {
            width: 100%;
            font-size: 16px;
            vertical-align: middle;
            padding-top: 14px;
        }
    }

    .table {
        border-right: 0;
        border-bottom: 0;
        width: 100%;
        word-break: break-all;
    }

    .tr {
        width: 100%;
        display: flex;
        justify-content: space-between;
    }

    .th, .td {
        /*text-align: left;*/
        width: 100%;
    }

    .th {
    }

    .table-bordered .td {
        border: 1px solid #ddd;
        padding: 5px;
    }

    .u-tag-group-line {
        view {
            margin: 4px;
        }
    }
</style>
